home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.5 KB | 147 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPat.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #if defined(FW_PROFILER_CALLS) && defined(__MWERKS__)
- #pragma profile on
- #endif
-
- #ifndef FWPAT_H
- #include "FWPat.h"
- #endif
-
- #ifndef FWBWPAT_H
- #include "FWBWPat.h"
- #endif
-
- #ifndef FWCPAT_H
- #include "FWCPat.h"
- #endif
-
- #ifndef FWGRGLOB_H
- #include "FWGrGlob.h"
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwgraphx
- #endif
-
- FW_DEFINE_CLASS_M1(FW_PPattern, FW_CGraphicCountedPtr)
- FW_DEFINE_CLASS_M1(FW_CPatternRep, FW_CGraphicCountedPtrRep)
-
- //========================================================================================
- // class FW_PPattern
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::FW_PPattern
- //----------------------------------------------------------------------------------------
-
- FW_PPattern::FW_PPattern() :
- FW_CGraphicCountedPtr()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::FW_PPattern
- //----------------------------------------------------------------------------------------
-
- FW_PPattern::FW_PPattern(const FW_BitPattern& bits) :
- FW_CGraphicCountedPtr()
- {
- SetRep(new FW_CBWPatternRep(bits));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::FW_PPattern
- //----------------------------------------------------------------------------------------
-
- FW_PPattern::FW_PPattern(const FW_PixelPattern& pixels, short nbColors, const FW_CColor* colorTable) :
- FW_CGraphicCountedPtr()
- {
- SetRep(new FW_CColorPatternRep(pixels, nbColors, colorTable));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::FW_PPattern
- //----------------------------------------------------------------------------------------
-
- FW_PPattern::FW_PPattern(const FW_PPattern& other) :
- FW_CGraphicCountedPtr(other)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::FW_PPattern
- //----------------------------------------------------------------------------------------
-
- FW_PPattern::FW_PPattern(FW_PlatformColorPattern platformColorPattern) :
- FW_CGraphicCountedPtr()
- {
- SetRep(new FW_CColorPatternRep(platformColorPattern));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::FW_PPattern
- //----------------------------------------------------------------------------------------
-
- FW_PPattern::~FW_PPattern()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::operator=
- //----------------------------------------------------------------------------------------
-
- FW_PPattern& FW_PPattern::operator=(const FW_PPattern& other)
- {
- // We don't need to test this == &other because SetRep will do it
- SetRep(other.GetRep());
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::operator=
- //----------------------------------------------------------------------------------------
-
- FW_PPattern& FW_PPattern::operator=(const FW_BitPattern& bits)
- {
- SetRep(new FW_CBWPatternRep(bits));
- return *this;
- }
-
- //========================================================================================
- // CLASS FW_CPatternRep
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CPatternRep::FW_CPatternRep
- //----------------------------------------------------------------------------------------
-
- FW_CPatternRep::FW_CPatternRep()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPatternRep::~FW_CPatternRep
- //----------------------------------------------------------------------------------------
-
- FW_CPatternRep::~FW_CPatternRep()
- {
- }
-